const { defineConfig } = require('@vue/cli-service')
const proxyObj = {}
proxyObj['/'] = {
  target: 'http://localhost:8080',
  changeOrigin: true,
  pathRewrite: {
    '^/': ''
  },
  ws:false
}
// module.exports = defineConfig({
//   transpileDependencies: true,
//   lintOnSave:false,
//   publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
//   devServer: {
//     host: 'localhost',
//     port: 8080,
//     proxy: proxyObj
//   },
//   outputDir: "dist",
// })
const webpack = require('webpack');
module.exports = defineConfig ({
    transpileDependencies:true,
    publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
    outputDir: "dist",
    lintOnSave:false,
    css: {
        loaderOptions: {  //向CSS相关的loader传递选项
            less: {
                javascriptEnabled: true
            }
        }
    },
    devServer:{
        port:8080,  //端口号
        // host: 'localhost',
        // proxy: proxyObj
    },
    configureWebpack: {//引入jquery
        plugins: [
            new webpack.ProvidePlugin({
                $:"jquery",
                jQuery:"jquery",
                "windows.jQuery":"jquery"
            }),
        ]
    },
});